home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesU-Z.lzh / Vaxine.lha / VaxineHD / Install next >
Text File  |  2000-07-03  |  4KB  |  212 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of the readme file
  4.  
  5. ;****************************
  6. ;----------------------------
  7. ; checks if given program is installed, if not abort install
  8. ; #program - to check
  9.  
  10. (procedure P_ChkRun
  11.   (if
  12.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  13.     ("")
  14.     (abort 
  15.       (cat
  16.     "You must install \"" #program "\" first!\n"
  17.     "It must be accessible via the path.\n"
  18.     "You can find it in the WHDLoad package."
  19.       )
  20.     )
  21.   )
  22. )
  23.  
  24. ;----------------------------
  25. ; Create Image using DIC
  26. ; #dest        - path to save image in
  27. ; #CI_disknum  - number of the disk image to create
  28. ; #CI_diskname - label of the disk
  29. ; #CI_disklen  - length of disk image to create
  30. ; #CI_skiptrk  - track to skip, -1 means no skip
  31. ; #CI_drive    - drive to create image from
  32.  
  33. (procedure P_CreateImage
  34.   (message
  35.     (cat
  36.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive " !\n\n"
  37.     "(make sure it's the right disk because it will not be checked)"
  38.     )
  39.   )
  40.   (if
  41.     (>= #CI_skiptrk 0)
  42.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  43.     (set #option "")
  44.   )
  45.   (if
  46.     (= 0
  47.       (run 
  48.         (cat
  49.           "cd \"" #dest "\"\n"
  50.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  51.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  52.         )
  53.       )
  54.     )
  55.     (run ("FileNote %s Quiet" #CI_diskname))
  56.     (abort "\"DIC\" has failed to create a diskimage")
  57.   )
  58. )
  59.  
  60. ;****************************
  61.  
  62. (if
  63.   (exists #readme-file)
  64.   (if
  65.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  66.     ("")
  67.     (run ("SYS:Utilities/More %s" #readme-file))
  68.   )
  69. )
  70.  
  71. (set #program "WHDLoad")
  72. (P_ChkRun)
  73.  
  74. (set #program "DIC")
  75. (P_ChkRun)
  76.  
  77. ; in expert mode ask for source drive
  78. (if
  79.   (= @user-level 2)
  80.   (
  81.     (set #CI_drive
  82.       (askchoice
  83.     (prompt "Select source drive for diskimages")
  84.     (default 0)
  85.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  86.     (help @askchoice-help)
  87.       )
  88.     )
  89.     (select #CI_drive
  90.       (set #CI_drive "DF0:")
  91.       (set #CI_drive "DF1:")
  92.       (set #CI_drive "RAD:")
  93.       (set #CI_drive
  94.         (askstring
  95.           (prompt "Select source drive for diskimages")
  96.           (default "DF0:")
  97.           (help @askstring-help)
  98.         )
  99.       )
  100.     )
  101.   )
  102.   (set #CI_drive "DF0:")
  103. )
  104.  
  105. (set @default-dest
  106.   (askdir
  107.     (prompt 
  108.       (cat
  109.     "Where should \"" @app-name "\" installed ?\n"
  110.     "A drawer \"" @app-name "\" will automatically created."
  111.       )
  112.     )
  113.     (help @askdir-help)
  114.     (default @default-dest)
  115.     (disk)
  116.   )
  117. )
  118. (set #dest (tackon @default-dest @app-name))
  119. (if
  120.   (exists #dest)
  121.   (
  122.     (set #choice
  123.       (askbool
  124.         (prompt
  125.           (cat
  126.             "\nDirectory \"" #dest "\" already exists.\n"
  127.             "Should it be deleted?"
  128.           )
  129.         )
  130.         (default 1)
  131.         (choices "Delete" "Skip")
  132.         (help @askbool-help)
  133.       )
  134.     )
  135.     (if
  136.       (= #choice 1)
  137.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  138.     )
  139.   )
  140. )
  141. (makedir #dest
  142.   (help @makedir-help)
  143.   (infos)
  144. )
  145.  
  146. ;----------------------------
  147.  
  148. (copyfiles
  149.   (help @copyfiles-help)
  150.   (source ("%s.Slave" @app-name))
  151.   (dest #dest)
  152. )
  153. (if
  154.   (exists ("%s.newicon" @app-name))
  155.   (set #icon
  156.     (askchoice
  157.       (prompt "\nWhich icon do you like to install ?\n")
  158.       (default 0)
  159.       (choices "Normal" "NewIcon" "GlowIcon")
  160.       (help @askchoice-help)
  161.     )
  162.   )
  163.   (set #icon 0)
  164. )
  165. (select #icon
  166.   (set #icon ("%s.inf" @app-name))
  167.   (set #icon ("%s.newicon" @app-name))
  168.   (set #icon ("%s.newicon" @app-name))
  169. )
  170. (copyfiles
  171.   (help @copyfiles-help)
  172.   (source #icon)
  173.   (newname ("%s.info" @app-name))
  174.   (dest #dest)
  175. )
  176. (if
  177.   (exists #readme-file)
  178.   (copyfiles
  179.     (help @copyfiles-help)
  180.     (source #readme-file)
  181.     (dest #dest)
  182.   )
  183. )
  184. (if
  185.   (exists ("%s.info" #readme-file))
  186.   (copyfiles
  187.     (help @copyfiles-help)
  188.     (source ("%s.info" #readme-file))
  189.     (dest #dest)
  190.   )
  191. )
  192. (if
  193.   (exists ("%s.highs" @app-name))
  194.   (copyfiles
  195.     (help @copyfiles-help)
  196.     (source ("%s.highs" @app-name))
  197.     (dest #dest)
  198.   )
  199. )
  200.  
  201. (copyfiles
  202.   (help @copyfiles-help)
  203.   (source ("%s" #CI_drive))
  204.   (dest #dest)
  205.   (pattern "(vaxine|vaxlogo.lbm)")
  206. )
  207.  
  208. ;----------------------------
  209.  
  210. (exit)
  211.  
  212.